package org.mx.jwt.config;

import org.mx.jwt.service.impl.JwtServiceImpl;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;

/**
 * 描述： JWT(JSON Web Tokens)服务配置类
 *
 * @author john peng Date time 2018/8/19 下午7:19
 */
public class JwtServiceConfig {
	/**
	 * 创建JWT服务对象
	 * 
	 * @return JWT服务对象
	 */
	@ConditionalOnProperty(prefix = "jwtauth", name = "enabled", havingValue = "true")
	@Bean(name = "jwtService", initMethod = "init", destroyMethod = "destroy")
	public JwtServiceImpl jwtService() {
		return new JwtServiceImpl();
	}
}
